<template>
  <QueryBar :inputs="qeuryInputs" url="get_chart2_field_options" @submit="submit" />

  <MyTable url="get_benefit_data" :defaultParams="{
    startTime: 1609459200000,
    endTime: 1686937922776,
  }" ref="table" :columns="columns" defaultCellWidth="130px">
    <template #operator = {row}>
      <lay-button size="xs" type="primary" @click="edit(row)">编辑</lay-button>
      <lay-button size="xs" @click="details(row)">查看</lay-button>
    </template>
  </MyTable>
</template>

<script setup>
import MyTable from "@/components/MyTable/index.vue";
import QueryBar from "@/components/QueryBar/index.vue";
import dayjs from "dayjs";
import { ref } from "vue";

const table = ref(null);

function submit(row) {
  table.value.reload(row)
}
const edit = (row) => {
  console.log(row)
}
const details = (row) => {

}
const columns = ref([
  { title: "收费代码", width: "100px", key: "项目院内代码", fixed: "left" },
  { title: "项目名称", width: "200px", key: "项目名称", fixed: "left" },
  { title: "数量", key: "数量" },
  { title: "单位", key: "单位" },
  { title: "开单科室", key: "开单科室" },
  { title: "执行科室", key: "执行科室" },
  { title: "金额", key: "金额" },
  {
    title: "操作",
    customSlot: "operator",
    key: "operator",
    fixed: "right",
  },
]);

const qeuryInputs = [
  {
    label: "起始时间",
    key: "startTime",
    default: 1609459200000,
    type: "date",
  },
  {
    label: "结束时间",
    key: "endTime",
    default: 1686937922776,
    type: "date",
  },
  {
    key: "项目名称",
    type: "select",
  },
  {
    key: "开单科室",
    type: "select",
  },
  {
    key: "执行科室",
    type: "select",
  },
  {
    label: "收费代码",
    key: "项目院内代码",
    type: "select",
  },
];
</script>

<style></style>